//Ajax

        //Ajax-XMLHttpRequest对象创建
        var request = new XMLHttpRequest();

        //兼容ie5 6
        var requestCompatible;
        if (window.XMLHttpRequest) {
            requestCompatible = new XMLHttpRequest();//IE7+,Firefox,Chrome,Opear..
        } else {
            requestCompatible = new ActiveXObject("Microsoft.XMLHTTP");//IE5,6
        }

        request.open("GET","",true);
        request.send();

        //Ajax-HTTP请求

        //Ajax-XMLHttpRequest发送请求 open(method类型,url,async是否异步处理)  send(string)
        request.open("GET", "get.php", true);
        request.send();

        request.open("POST", "create.php", true);
        request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        request.send("name=园&sex=男");

        //Ajax-XMLHttpRequest取得响应
        responseText//获得字符串形式的响应数据
        responseXML//过的XML形式的响应数据
        status / statusTExt//以数字和文本形式返回HTTP状态码
        getAllResponseHeader()//获取所有的响应报头
        getResponseHeader()//查询响应中的某个字段的值

        //readystate 监听服务器响应 
        //0 open还没有被调用
        //1 open已经被调用，服务器连接已建立
        //2 请求已接收，接收到头条信息
        //3 请求处理中，接收到响应主体
        //4 请求已完成，且响应已就绪
        request.onreadystatechange = function () {
            if (request.readyState === 4 && request.status === 200) {
                //做一下事情 request.responseText

            }
        }

        var aa = new XMLHttpRequest();
        aa.onreadystatechange = function () {
            if (aa.readyState === 4 && aa.status === 200) {
                aa.responseText;
            }
        }
        aa.open("POST", "index.html".true);
        aa.send();


        var xmlhttp;
        if (window.XMLHTTPRequest) {
            xmlhttp = new XMLHttpRequest();
        } else {
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange = function () {
            if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {
                document.getElementById("").innerHTML = xml;
            }
        }
        xmlhttp.open("OPST", "", true);
        xmlhttp.send();



        
//例
        function loadXMLDoc() {
            var xhttp = new XMLHttpRequest();
            xhttp.onreadystatechange = function () {
                if (this.readyState == 4 && this.status == 200) {
                    myFunction(this);
                }
            };
            xhttp.open("GET", "cd_catalog.xml", true);
            xhttp.send();
        }
        function myFunction(xml) {
            var i;
            var xmlDoc = xml.responseXML;
            var table = "<tr><th>Artist</th><th>Title</th><th>Country</th></tr>";
            var x = xmlDoc.getElementsByTagName("CD");
            for (i = 0; i < x.length; i++) {
                table += "<tr><td>" +
                    x[i].getElementsByTagName("ARTIST")[0].childNodes[0].nodeValue +
                    "</td><td>" + x[i].getElementsByTagName("COUNTRY")[0].childNodes[0].nodeValue +
                    "</td><td>" + x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue +
                    "</td></tr>";
            }
            document.getElementById("demo").innerHTML = table;
        }